package
{
	import org.flixel.*;
	import org.flixel.plugin.photonstorm.FlxWeapon;

	public class Registry
	{

		public static var player:Player; // Reference to the player
		public static var enemies:EnemyManager; // Reference to the enemy manager
		//public static var powerups:Powerups; // Reference to the game powerups
		public static var hud:HUD; // Reference to the game head's up display
		//public static var effects:Effects; // Reference to the game's special effects (emitters, etc.)
		public static var fx:FX;
		public static var knightBulletGroup:FlxGroup;
		public static var knightWep:FlxWeapon;
		public static var knights:KnightManager;
		
		public static var positionOffset:FlxPoint;
		public static var currentWeapon:FlxWeapon;
		public static var currentLevel:int; // Keeps track of the current level
		public static var scoreThisLevel:int; // Keeps track of the score for the current level
		public static var scoreThisGame:int; // Keeps track of the score for the whole game
		public static var enemiesKilledThisLevel:int; // Keeps track of the number of enemies killed this level
		public static var enemiesKilledThisGame:int;  // Keeps track of the number of enemies killed the whole game

		// We're going to use these to keep track of the player's accurary during the game
		public static var shotsFiredThisLevel:int; // Shots fired during the current level
		public static var shotsFiredThisGame:int; // Shots fired during the game
		public static var enemiesHitThisLevel:int; // Number of shots that struck enemies on the current level
		public static var enemiesHitThisGame:int; // Number of shots that struck enemies during the game

		public function Registry()
		{
		}
		
		public static function init():void {
			fx = new FX();
			hud = new HUD();
			knightBulletGroup = new FlxGroup();
			knights = new KnightManager();
			
			knightWep = new FlxWeapon("Knight-rockets");
			knightWep.makePixelBullet(20, 10, 5, 0xFF000000);
			knightWep.setFireRate(1);
			knightWep.setBulletSpeed(300);
			knightWep.setBulletBounds(new FlxRect(0, 26, FlxG.width, FlxG.height));
			knightWep.setBulletGravity(0, 0);
			knightBulletGroup.add(knightWep.group);
		}
	}
}